<include file="Public/ace_header" />
<div class="row">
<form class="form-horizontal" role="form" method="post" action="" style="padding-left: 10px;padding-right: 10px;">
    <div class="col-md-4 col-md-offset-4">
        <div>
            <h2>打印选择</h2></div>
        <div>
            <h3>姓名：{$student['name']}</h3></div>
        <!-- <form class="form-horizontal" role="form" method="post" style="padding-left: 10px;padding-right: 10px;"> -->
           <foreach name="record" item="r">
             <div class="form-group">
            <div class="checkbox" >
                <label>
                    <input type="checkbox" class="recordids" value="{$r['id']}"><?=M('Term')->find($r["term_id"])['name'];?> : {$r['money']}
                </label>
            </div>
             <div style="margin-bottom: 5px;"></div>
           </div>
            </foreach>

            <a data-href="__CONTROLLER__/Print?student_id={$student['id']}&recordidStr="" id="printBtn" class="btn  btn-info btn-sm " onclick="printFee()"  target="_blank" >打印</a>
            </form>
            <a href="{:U('Record/RecordR')}"> <button type="button" class="btn btn-sm">返回</button></a>
        
    </div>
</div>
<script type="text/javascript">
    function printFee() {
        var recordidStr = '';
        $('.recordids').each(function(i){
            if ($(this).is(':checked')) {
                recordidStr += $(this).val()+',';
            }
        });
        var href=$('#printBtn').attr('data-href');
        window.open(href+recordidStr,'打印','width=800,height=300')
        return false;
    }
</script>
<include file="Public/ace_footer" />
